package logic;
import java.io.IOException;
import java.util.Vector;


public class ThreadHello implements Runnable {
	
	private Server server;
	private String ipAddress;
	
	public ThreadHello(Server server, String ip)
	{
		this.setServer(server) ;
		this.setIpAddress(ip);
	}
	@Override
	public void run() {
		Vector<String> files = server.getDeletedFiles().getFilesID(getIpAddress());
		
		if(files == null)
			return;
		else{
			for(int i =0; i<files.size();i++){
				//myFile file = Server.getFileRepository().getFile(files.elementAt(i));
				myFile file = new myFile(files.elementAt(i));
				try {
					server.deleteFile(file);
				} catch (IOException | InterruptedException e) {
					// TODO Auto-generated catch block
					//e.printStackTrace();
				}
			}
		}
		
	}
	public Server getServer() {
		return server;
	}

	public void setServer(Server server) {
		this.server = server;
	}

	public String getIpAddress() {
		return ipAddress;
	}

	public void setIpAddress(String ipAddress) {
		this.ipAddress = ipAddress;
	}

	
	
}
